From a3e9d29bb3d23dbc2c8f20b9b724c0d6c932f0e8 Mon Sep 17 00:00:00 2001 From: Rob Savoury Date: Tue, 23 Aug 2022 13:39:08 -0700 Subject: [PATCH] Fix build with system litehtml CMake errors out when using system litehtml (which depends on gumbo) due being unable to set definitions for libraries not built by the Qt6 Tools project: CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6/QtFlagHandlingHelpers.cmake:171 (target_compile_definitions): Cannot specify compile definitions for target "litehtml" which is not built by this project. Call Stack (most recent call first): src/assistant/CMakeLists.txt:34 (qt_internal_set_exceptions_flags) CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6/QtFlagHandlingHelpers.cmake:190 (get_target_property): get_target_property() called with non-existent target "litehtml". Call Stack (most recent call first): src/assistant/CMakeLists.txt:35 (qt_disable_warnings) CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6/QtFlagHandlingHelpers.cmake:190 (get_target_property): get_target_property() called with non-existent target "gumbo". Call Stack (most recent call first): src/assistant/CMakeLists.txt:37 (qt_disable_warnings) Also, litehtml > 0.5 reorganises the headers into a litehtml sub-directory (this build is with exactly litehtml 0.5+git20211028, the same version found in Qt6 Tools source code). Fix the build by removing attempts to set Qt defs for litehtml/gumbo and by using the new path to the primary header. Gbp-Pq: Name fix-build-with-system-litehtml.patch --- src/assistant/CMakeLists.txt | 7 ------- src/assistant/qlitehtml/src/container_qpainter_p.h | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/assistant/CMakeLists.txt b/src/assistant/CMakeLists.txt index 868eefd..9253ed8 100644 --- a/src/assistant/CMakeLists.txt +++ b/src/assistant/CMakeLists.txt @@ -35,13 +35,6 @@ if(TARGET qlitehtml) # but found in the system, because they are imported only to the subdirectory scope # where find_package was called. But that's fine, we wouldn't be able to set compiler flags # on them anyway. - if(TARGET litehtml) - qt_internal_set_exceptions_flags(litehtml OFF) - qt_disable_warnings(litehtml) - endif() - if(TARGET gumbo) - qt_disable_warnings(gumbo) - endif() qt_disable_warnings(qlitehtml) qt_handle_multi_config_output_dirs(qlitehtml) set_target_properties(qlitehtml PROPERTIES diff --git a/src/assistant/qlitehtml/src/container_qpainter_p.h b/src/assistant/qlitehtml/src/container_qpainter_p.h index 8fb1e0b..9d909a2 100644 --- a/src/assistant/qlitehtml/src/container_qpainter_p.h +++ b/src/assistant/qlitehtml/src/container_qpainter_p.h @@ -5,7 +5,7 @@ #include "container_qpainter.h" -#include +#include #include #include -- 2.30.2